package com.ht.system.api;

import com.ht.common.core.constant.SecurityConstants;
import com.ht.common.core.constant.ServiceNameConstants;
import com.ht.common.core.domain.R;
import com.ht.system.api.dto.EnterpriseDto;
import com.ht.system.api.dto.EnterpriseInfoDto;
import com.ht.system.api.factory.RemoteCustomsFallbackFactory;
import com.ht.system.api.factory.RemoteEnterpriseInfoFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
 * @Description 远程调用企业信息接口
 * @Version 1.0
 * @Author zmx
 * @Date 2025/3/27 0027 16:47
 */
@FeignClient(contextId = "remoteEnterpriseInfoService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteEnterpriseInfoFallbackFactory.class)
public interface RemoteEnterpriseInfoService {
    /**
     * 获得企业信息包括字表信息
     *
     * @param entCode
     * @param source
     * @return
     */
    @GetMapping("enterpriseInfo/findAllByEntCode/{entCode}")
    public R<EnterpriseInfoDto> findAllByEntCode(@PathVariable("entCode") String entCode, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 获得企业信息部包括字表
     *
     * @param entCode
     * @param source
     * @return
     */
    @GetMapping("enterpriseInfo/findByEntCode/{entCode}")
    public R<EnterpriseInfoDto> findByEntCode(@PathVariable("entCode") String entCode, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 获得所有企业信息
     *
     * @param source
     * @return
     */
    @GetMapping("/enterpriseInfo/findAllEnterprise")
    public R<List<EnterpriseDto>> findAllEnterprise(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
